package com.company.poker.channel;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import org.jboss.netty.channel.Channel;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Description of class.
 * Created 4/25/13 5:55 PM
 *
 * @author andrey.rodin@playtech.com
 */

public class ChannelContext {
    private final ActorSystem actorSystem ;
    private ActorRef table;
    private ActorRef table2;
    private Map<String, Channel> sessionCash = new ConcurrentHashMap<String, Channel>();

    public ChannelContext(ActorSystem actorSystem) {
        this.actorSystem = actorSystem;
        table = actorSystem.actorOf(new Props(TableActor.class),"table");
        table2 = actorSystem.actorOf(new Props(TableActor.class),"table2");
    }

    public ActorSystem getActorSystem() {
        return actorSystem;
    }

    public ActorRef getTable() {
        return table;
    }

    public ActorRef getTable2() {
        return table2;
    }

    public Map<String, Channel> getSessionCash() {
        return sessionCash;
    }
}
